home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Module source / vol < prev   
Text File  |  1986-09-22  |  970b  |  43 lines

  1. \ Volume level calls
  2. \  7/26/84  CBD Version 1.0
  3. \  1/01/85  rw  FlushVol
  4.  
  5. \ get info for default vol - leave vol name at pad
  6. : volinfo { -- fcode }
  7.     0 ffcb 22 + w!
  8.     0 ffcb 28 + w!
  9.     HFS? IF
  10.         9 ffcb +base dirfind
  11.     ELSE ffcb fcall pbgetvinfo
  12.     then ;
  13. \ ( -- #files )
  14. : filecount volinfo drop
  15.     HFS? IF ffcb 52 + w@
  16.     ELSE ffcb 40 + w@
  17.     THEN ;
  18.  
  19. \ ( file# -- b )  leave name of file at pad
  20. : Getidxfile { \ dirid -- }
  21.     fFcb 28 + w!            \ set file index
  22.     pad +base fFcb 18 + !    \ filename addr
  23.     pad 64 blanks getdirid: ffcb -> dirid
  24.     fFcb fcall PBHGetFInfo
  25.     0= IF true ELSE  false THEN
  26.     dirid setdirid: ffcb
  27.     13 pad count + 1+ c! ;
  28.  
  29. \ Print directory for current volume
  30. : Dir
  31.     0 -> curs  fFcb  clrFcb Filecount  1+ 1
  32.     ." Directory for Volume: "
  33.     Pad count type cr
  34.     DO   I Getidxfile Pad count Type CR ?Pause LOOP
  35.     Filecount .  ."  Files." CR  1 -> curs  ;
  36.  
  37. : FlushVol
  38.     clear: fFcb
  39.     volinfo abort" GetVolInfo failed"
  40.     0 fFcb 12 + !
  41.     fFcb fcall PBFlushVol abort" FlushVol failed"
  42. ;
  43.